let arr1 = [1,2,3,7,6,1,2,3]
let arr2 = [7,6,5,4,3,2,1,2,9,2,3]
// 对数组去重
arr1 = Array.from(new Set(arr1))
arr2 = Array.from(new Set(arr2))
console.log(arr1); //[1,2,3,6,7]
console.log(arr2); // [1,2,3,4,5,6,7,9]

// 1并集
let arrb = Array.from(new Set(arr1.concat(arr2)))
console.log(arrb);
// 2并集
let arrb2 = Array.from(new Set([...arr1,...arr2]))
console.log(arrb2);

// 交集
let intersect = [...new Set([...arr1].filter(x => arr2.has(x)))];
console.log(intersect)

let arrj = Array.from(new Set(arr1.map(item=>arr2.has(item))))
console.log(arrj);

// 差集
let arrc = Array.from(new Set(arr1.map(i=>!arr2.has(i))))
console.log(arrc);